package cn.ac.iscas.chinesesegmentme;

import java.io.BufferedOutputStream;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintStream;

public class FormatOutput {

	public static void main(String[] args) throws IOException {
		
		PrintStream ps = new PrintStream(
		        new BufferedOutputStream(new FileOutputStream(
		        new File("data/result.txt"))), true);
		System.setOut(ps);   
//		
		
		Tokenizer tr = new Tokenizer();
		FileReader reader = new FileReader(
		"data/pku_test.utf8.new");
		BufferedReader br = new BufferedReader(reader);
		
		FileReader pReader = new FileReader(
		"data/predict_i112.txt");
		BufferedReader pbr = new BufferedReader(pReader);
		
		
		String line = null;
	
		while ((line = br.readLine()) != null) {
			tr.tokenizeTestLine(line, pbr);
		}
		tr.generateResultFile();
		br.close();
		reader.close();
		pbr.close();
		pReader.close();
	}
	
}
